package io.adrainty.bolee.security.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import io.adrainty.bolee.security.models.bo.RoleBO;
import io.adrainty.bolee.security.models.entity.RoleEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @author AdRainty
 * @version V1.0.0
 * @since 2025/8/9 下午11:21
 */

@Mapper
public interface IRoleMapper extends BaseMapper<RoleBO> {

    /**
     * 根据用户ID查询角色
     *
     * @param userIdList 用户ID
     * @return 角色列表
     */
    List<RoleEntity> findRoleByUserId(@Param("userIdList") List<Long> userIdList);

    /**
     * 根据资源编号列表查询角色
     *
     * @param resourceNoList 资源编号列表
     * @return 角色列表
     */
    List<Map<String, Object>> findRoleListByResourceNo(@Param("resourceNoList") List<String> resourceNoList);
}
